@extends('admin.layout.common')
@section('content')
    <link rel="stylesheet" type="text/css" href="{{URL::asset('css/user/RoleManagement.css')}}">
    <link rel="stylesheet" type="text/css" href="{{URL::asset('css/app.css')}}">
    <div class="content">
    <h1 class="h1">用户角色管理</h1>
    <form action="">
        <input type="button" value="添加角色"  onclick="javascript:window.location.href='{{URL('admin/addRole')}}'" style="width:140px;margin-right:20px;height:40px;cursor:pointer;">
    </form>
    <table border="1" width="100%">
        <tr>
            <th>ID</th>
            <th>角色名称</th>
            <th>状态</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        @foreach($list as $v)
            <tr>
                <td>{{$v->id}}</td>
                <td>{{$v->name_cn}}</td>
                @if($v->status==1)
                <td>启用</td>
                @else
                <td>禁用</td>
                @endif
                <td>{{$v->create_time}}</td>
                <td>
                    <input type="button" name="" value="编辑" onclick="javascript:window.location.href='{{URL('admin/editRole/'.$v->id)}}'" style="background:#fff;color:#333;border:1px solid #ccc;">
                    @if($v->status==1)
                    <input type="button" name="" value="禁用" onclick="javascript:window.location.href='{{URL('admin/stopRole/'.$v->id)}}'" style="background:#999999;">
                    @else
                    <input type="button" name="" value="启用" onclick="javascript:window.location.href='{{URL('admin/startRole/'.$v->id)}}'" style="background:#009688;">
                    @endif
                </td>
            </tr>
        @endforeach
    </table>
        {{ $list->links() }}
    </div>
<script type="text/javascript" src="{{asset('js/user/personal.js')}}"></script>
@endsection

